% TEST_ID: LANG-EXPAND-0052
% CATEGORY: language/reflection
% 测试 inputname 函数

function test_inputname
    x = 1;
    test_entry(x, 1);

    test_entry1();

    % cell解包传参
    v = {1, 2};
    func2(v{:});
end


function test_entry(a0, a1)
    assert(isequal(inputname(1), 'x'));
    assert(isequal(inputname(2), ''));
end

function func1(a0, a1)
    assert(isequal(inputname(1), 'x0'));
    assert(isequal(inputname(2), 'x1'));
end


function func2(a0, a1)
    assert(isequal(inputname(1), ''));
    assert(isequal(inputname(2), ''));
end

function test_entry1()
    x0 = 1;
    x1 = 2;
    func1(x0, x1);
end
